#ifndef GAMEOBJECTSTREEWIDGET_H
#define GAMEOBJECTSTREEWIDGET_H

#include "appGlobals.h"
#include <QTreeWidget>
class AbstractGameObject;
class Document;
namespace Modes { class EditorMode; }

struct GameObjectsTreeWidgetItem : public QTreeWidgetItem
{
    QPointer<AbstractGameObject> object;
};

class GameObjectsTreeWidget : public QTreeWidget
{
    Q_OBJECT
	friend class GameObjectsEditorWidget;
public:
    explicit GameObjectsTreeWidget(QWidget *parent = 0);
private:
	void setObjectEditorMode(QPointer<Modes::EditorMode> oem);
	void populateView();
signals:
	void selectedObjectChanged(QPointer<AbstractGameObject> go);
public slots:
    void onGameObjectAdded(QPointer<AbstractGameObject> go);
    void onGameObjectRemoved(QPointer<AbstractGameObject> go);
private slots:
	void onDocumentChanged(QPointer<Document> document);
	void onItemSelectionChanged();
	void onObjectDataChanged(QPointer<AbstractGameObject> go);
};

#endif // GAMEOBJECTSTREEWIDGET_H
